package com.xiaoxin.autoconfig;

import com.xiaoxin.autoconfig.properties.AipFaceProperties;
import com.xiaoxin.autoconfig.properties.HuanXinProperties;
import com.xiaoxin.autoconfig.properties.OssProperties;
import com.xiaoxin.autoconfig.properties.SmsProperties;
import com.xiaoxin.autoconfig.template.AipTemplate;
import com.xiaoxin.autoconfig.template.HuanXinTemplate;
import com.xiaoxin.autoconfig.template.OssTemplate;
import com.xiaoxin.autoconfig.template.SmsTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/**
 * @author xiaoxiaode
 * @date 2021-08-27-22:07
 **/
@EnableConfigurationProperties(
        {SmsProperties.class,
         OssProperties.class,
         AipFaceProperties.class,
         HuanXinProperties.class
        })
public class AutoConfiguration {

    @Bean
    public SmsTemplate smsTemplate(SmsProperties smsProperties) {
        return new SmsTemplate(smsProperties);
    }

    @Bean
    public OssTemplate ossTemplate(OssProperties properties) {
        return new OssTemplate(properties);
    }

    @Bean
    public AipTemplate aipTemplate() {
        return new AipTemplate();
    }

    @Bean
    public HuanXinTemplate huanXinTemplate(HuanXinProperties properties){
        return new HuanXinTemplate(properties);
    }
}
